package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.ErpBusinessInformationMapper;
import com.ly.heart.domain.ErpBusinessInformation;
import com.ly.heart.service.IErpBusinessInformationService;

import javax.annotation.Resource;

/**
 * 商务信息Service业务层处理
 * 
 * @author wutao
 * @date 2024-05-19
 */
@Service
public class ErpBusinessInformationServiceImpl extends ServiceImpl<ErpBusinessInformationMapper,ErpBusinessInformation> implements IErpBusinessInformationService
{
    @Resource
    private ErpBusinessInformationMapper erpBusinessInformationMapper;

    /**
     * 查询商务信息
     * 
     * @param id 商务信息ID
     * @return 商务信息
     */
    @Override
    public ErpBusinessInformation selectErpBusinessInformationById(String id)
    {
        return erpBusinessInformationMapper.selectErpBusinessInformationById(id);
    }

    /**
     * 查询商务信息列表
     * 
     * @param erpBusinessInformation 商务信息
     * @return 商务信息
     */
    @Override
    public List<ErpBusinessInformation> selectErpBusinessInformationList(ErpBusinessInformation erpBusinessInformation)
    {
        return erpBusinessInformationMapper.selectErpBusinessInformationList(erpBusinessInformation);
    }

    /**
     * 新增商务信息
     * 
     * @param erpBusinessInformation 商务信息
     * @return 结果
     */
    @Override
    public int insertErpBusinessInformation(ErpBusinessInformation erpBusinessInformation)
    {
        erpBusinessInformation.setId(SnowflakeIdWorker.getInstance().nextStringId());
        erpBusinessInformation.setCreateTime(DateUtils.getNowDate());
        return erpBusinessInformationMapper.insertErpBusinessInformation(erpBusinessInformation);
    }

    /**
     * 修改商务信息
     * 
     * @param erpBusinessInformation 商务信息
     * @return 结果
     */
    @Override
    public int updateErpBusinessInformation(ErpBusinessInformation erpBusinessInformation)
    {
        erpBusinessInformation.setUpdateTime(DateUtils.getNowDate());
        return erpBusinessInformationMapper.updateErpBusinessInformation(erpBusinessInformation);
    }

    /**
     * 批量删除商务信息
     * 
     * @param ids 需要删除的商务信息ID
     * @return 结果
     */
    @Override
    public int deleteErpBusinessInformationByIds(String[] ids)
    {
        return erpBusinessInformationMapper.deleteErpBusinessInformationByIds(ids);
    }

    /**
     * 删除商务信息信息
     * 
     * @param id 商务信息ID
     * @return 结果
     */
    @Override
    public int deleteErpBusinessInformationById(String id)
    {
        return erpBusinessInformationMapper.deleteErpBusinessInformationById(id);
    }
}
